﻿using System;
using System.Collections;
using System.Linq;
using System.Text;
using TravianHelper.hero;
using TravianHelper.app;

namespace TravianHelper
{
    [System.Xml.Serialization.XmlInclude(typeof(Zone))]
    [System.Xml.Serialization.XmlInclude(typeof(Troop))]
    public class Village
    {
        public string name;
        public string id;
        public int x;
        public int y;
        public int current;
        public long lastSent;
        public ArrayList oasis = new ArrayList();
        public ArrayList troops = new ArrayList();

        public void resetDefend()
        {
            for (int i = 0; i < oasis.Count; i++)
            {
                Zone zone = (Zone)oasis[i];
                zone.defend = int.MaxValue;
            }
        }

        public int getNCleanOasis()
        {
            int count = 0;
            foreach (Zone zone in oasis)
            {
                if (zone.defend == 0 || zone.defend == int.MaxValue) count++;
            }
            return count;
        }
    }

}
